def fibo(n):

    if n <= 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibo(n-1) + fibo(n-2)

def print_fibonacci_sequence(num):
    """
    打印完整的斐波那契数列直到第num项
    :param num: 要打印的斐波那契数列的项数
    """
    if num <= 0:
        print("请输入一个正整数。")
    else:
        print("斐波那契数列:")
        for i in range(num):
            print(fibo(i), end=" ")

if __name__ == "__main__":
    try:
        user_input = int(input("请输入要计算的斐波那契数列的项数: "))
        print_fibonacci_sequence(user_input)
    except ValueError:
        print("错误: 请输入一个有效的整数。")